<?php

namespace app\middleware;

use think\Request;
use think\Response;

class AuthMiddleware
{
    public function handle(Request $request, \Closure $next): Response{
       if (!\AppData::miniProgram()){
           return $next($request);
       }

       return json([
           "code" => 301,
           "message" => "请先登录"
       ]);
    }
}